package cn.eshore.bnet.bpm.service.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.exe.ExecutionContext;
import org.springframework.stereotype.Component;

import cn.eshore.bnet.bpm.service.ProcessException;

@Component("callSI")
public class CallSI extends Action {
    static Log LOG = LogFactory.getLog(CallSI.class);

    private static final long serialVersionUID = 1L;

    public void execute(ExecutionContext executionContext) throws Exception {

        final String IS_FIRST = "IS_FISRT";
        System.out.println("call si interface , IS_FIRST:"
                + executionContext.getVariable(IS_FIRST));

        if (executionContext.getVariable(IS_FIRST) == null) {
            executionContext.setVariable(IS_FIRST, true);
            throw new ProcessException("test exception");
        } else {
            return;
        }

        // executionContext.getToken().signal();
    }

}
